#ifndef DOMINIO_H_
#define DOMINIO_H_

#include <iostream>
#include <list>
#include <string>
#include <ctime>

#include "URL.h"
#include "Robots.h"

class Dominio {
public:
	Dominio(){};
	Dominio(const std::string &aName, const std::time_t &time);
	virtual ~Dominio() { delete robots;}
	
	void updateTimestamp(time_t newTimestamp) { 
		timestamp = newTimestamp;
	}

	std::string getName() {return name;}
	std::time_t getTimestamp() {return timestamp;}
	bool isAllowedByRobots (URL * url) { return robots->isAllowed(url->get_path()); }
	bool isRobotsValid() { return (robots!=NULL); }
	void setRobots (Robots * robs) { robots = robs; }
	
private:
	std::string name;
	Robots * robots;
	std::time_t timestamp;
};



#endif /*DOMINIO_H_*/
